<style>
    .nav-pills > li{float:none;}
    .curr{ background-color: #eee;}
</style>
<link rel="stylesheet" href="/assets/css/draggable.css">
<div class="row">
    <div class="col-xs-12 col-sm-6 col-md-2 col-lg-2">
        <div class="panel panel-default panel-intro">
            <div class="panel-body">
                <div id="1" class="tab-content">
                    <div class="tab-pane fade active in" id="one">
                        <div class="widget-body no-padding">
                            {:build_select('row[school_id]', $schoolData, null, ['class'=>'form-control school', 'data-rule'=>'required'])}
                            <div id="teacherList"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-xs-12 col-sm-6 col-md-10 col-lg-10">
        <div class="panel panel-default panel-intro">
            <div class="panel-body">
                <div id="myTabContent2" class="tab-content">
                    <div class="tab-pane fade active in" id="two">
                        <div class="widget-body no-padding">
                            <div class="row">
                                <div class="col-xs-12 col-sm-12">
                                    <div class="form-inline">
                                        <select class="form-control semester" style="width: 120px;">
                                        </select>
                                        <select class="form-control semester_num" name="num">
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div id="divcontainer" class="container">
                                <div class="right" id="schedule">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/html" id="semesterTpl">
    <option value="0">请选择</option>
    <% for(var i=0; i< data.length; i++){ %>
    <option value="<%=data[i].id%>"><%=data[i].name%></option>
    <% } %>
</script>

<script type="text/html" id="teacherListTpl">
    <div class="box box-success" style="margin-top: 20px;">
        <div class="box-header with-border">
            <h6 class="box-title">教师列表</h6>
            <div class="box-tools pull-right">
                <a href="javascript:;" class="btn btn-primary btn-refresh" title="刷新"><i class="fa fa-refresh"></i> </a>
            </div>
        </div>
        <div class="box-body">
            <ul class="nav nav-pills nav-stacked">
                <% for(i in searchlist){ %>
                <li class="teacher" data-id="<%=searchlist[i].id%>"><a href="javascript:;" ><%=searchlist[i].name%></a></li>
                <% } %>
            </ul>
        </div>
    </div>
</script>

<script type="text/html" id="scheduleTpl">
    <table>
        <thead>
        <tr>
            <th>节次</th>
            <th>星期一</th>
            <th>星期二</th>
            <th>星期三</th>
            <th>星期四</th>
            <th>星期五</th>
            <th>星期六</th>
            <th>星期日</th>
        </tr>
        </thead>
        <tbody>

        <% for(i in data){ %>
        <tr>
            <th class="span"><%=i%></th>
            <% for(j in data[i]){ %>
            <td>
                <% if(data[i][j] && data[i][j].subject_name){ %>
                    <div draggable="true" class="color<%=data[i][j].num%> item">
                        <%=data[i][j].subject_name%> <br>
                        <%=data[i][j].grade_name%>
                        <%=data[i][j].class_name%><br>
                        <%=data[i][j].start_time%>-<%=data[i][j].end_time%>
                    </div>
                <% } %>
            </td>
            <% } %>
        </tr>
        <% } %>

        </tbody>
    </table>
</script>